import request from '@/config/axios'

export interface DayPriceVO {
  id: number
  cateId: number
  price: number
  day: string
}

// 查询每日价格列表
export const getDayPricePage = async (params) => {
  return await request.get({ url: `/cms/day-price/page`, params })
}

// 查询每日价格详情
export const getDayPrice = async (id: number) => {
  return await request.get({ url: `/cms/day-price/get?id=` + id })
}

// 新增每日价格
export const createDayPrice = async (data: DayPriceVO) => {
  return await request.post({ url: `/cms/day-price/create`, data })
}

// 修改每日价格
export const updateDayPrice = async (data: DayPriceVO) => {
  return await request.put({ url: `/cms/day-price/update`, data })
}

// 删除每日价格
export const deleteDayPrice = async (id: number) => {
  return await request.delete({ url: `/cms/day-price/delete?id=` + id })
}

// 导出每日价格 Excel
export const exportDayPrice = async (params) => {
  return await request.download({ url: `/cms/day-price/export-excel`, params })
}
